package com.hqins.app.cloud.eurekaclient.hello;

import com.hqins.app.cloud.common.ResponseObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class HelloController {
    @Value("${server.port}")
    String port;

    @Resource
    ResponseObject responseObject;

    @RequestMapping(value = "/hi/{name}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    public ResponseObject hello(@PathVariable String name) {
        HelloModel hello = new HelloModel();
        hello.setName(name + "----" + port);
        responseObject.setContent(hello);
        return responseObject;
    }
}
